CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT(FTGL)
SET(CMAKE_MODULE_PATH ${FTGL_SOURCE_DIR})

SET(VERSION_SERIES 2)
SET(VERSION_MAJOR 3)
SET(VERSION_MINOR 0)
SET(FTGL_SOVERSION 1)

FIND_PACKAGE(Freetype REQUIRED) # if it fails, check this: https://bugs.launchpad.net/ubuntu/+source/cmake/+bug/826988
#FIND_PACKAGE(OpenGL   REQUIRED)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/FTFont ${CMAKE_CURRENT_SOURCE_DIR}/src/FTGL ${CMAKE_CURRENT_SOURCE_DIR}/src/FTGlyph ${CMAKE_CURRENT_SOURCE_DIR}/src/FTLayout ${FREETYPE_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR})

IF(NOT CMAKE_BUILD_TYPE)
  SET(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)

# Allow the developer to select if Dynamic or Static libraries are built
OPTION(BUILD_SHARED_LIBS "Build Shared Libraries" ON)
IF(BUILD_SHARED_LIBS)
 	SET(LIB_TYPE SHARED)
ELSE(BUILD_SHARED_LIBS)
	SET(LIB_TYPE STATIC)
	ADD_DEFINITIONS(-D FTGL_LIBRARY_STATIC)
ENDIF(BUILD_SHARED_LIBS)

ADD_CUSTOM_TARGET(doc)


SUBDIRS(src)



if (WIN32)
  set(cmakedir cmake)
else ()
  set(cmakedir lib/cmake/FTGL)
endif ()
